package com.itheima.d12_framework;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * 目标：掌握IO框架的基本使用
 */
public class Test {

    public static void main(String[] args) throws IOException {
        //Commons-io框架：
        //FileUtils.copyDirectory(new File("D:\\javabase_ws\\JavaAdvanceProject\\day11_io") ,new File("d:\\day11_io"));
        //System.out.println("复制完毕！");

        /*List<String> datas = IOUtils.readLines(new FileInputStream("day11_io\\src\\com\\itheima\\d06_io_buffer_case\\haiyan.txt"));

        for (String data : datas) {
            System.out.println(data);
        }*/

        //Hutool框架：
        //FileUtil.copy("D:\\javabase_ws\\JavaAdvanceProject\\day11_io","d:\\",true);
        //System.out.println("复制完毕！");


        String data = IoUtil.readUtf8(new FileInputStream("day11_io\\src\\com\\itheima\\d06_io_buffer_case\\haiyan.txt"));
        System.out.println( data );
    }
}
